package com.zs.rocketmqstream.oldway;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author madison
 * @description
 * @date 2021/7/4 15:10
 */
@RestController
public class RocketController {

    @Autowired
    private StreamClient streamClient;

    @GetMapping("/")
    public void sendSucceed() {
        streamClient.output().send(MessageBuilder.withPayload("Hello World...")
//                .setHeader("routingKey", "login.user.succeed")
//                .setHeader("version", "1.0")
//                .setHeader("x-delay", 5000)
                .build());
    }
}
